let {GetMsgListService,InsertMsgService} = require('../service/msg.service')
class MsgController{
    async getMsgList(req,res,next){
       let {userID,toUserID} = req.query;
       let result = await GetMsgListService(userID,toUserID);
        // 查询结果响应
       res.json(result)
    }
    // 插入消息:初始化时可获取历史消息
    async insetMsg({userID,toUserID,msg}){
        let result = await InsertMsgService({userID,toUserID,msg});
      //  console.log('insert msg------',result)
        // 响应结果
        // res.json('insert msg success!');
    }

}
module.exports = new MsgController();
